@extends('linfeng.home.person')
@section('title','完善信息')

@section('first-person')
    <div class="setting-detail" id="stthld" style="display: block;">
        <div class="detail-bg"></div>
        <div class="plzhld clearfix">
            <div style="font-size:14px;padding:20px;" class="modal-content">
            <div class="mod-setting-profile">
                <div class="setting-profile-title yahei">管理员反馈 &nbsp;&nbsp;<b style="cursor:pointer;" id="gofeed">查看我的反馈</b></div>
                <div class="readuserfeed" style="position: absolute;">

                        {{--<table class="table my-order-list ord" style="display: none">--}}
                            {{--<tr class="warning">--}}
                                {{--<th>反馈id</th>--}}
                                {{--<th>概括</th>--}}
                                {{--<th>内容</th>--}}
                                {{--<th>反馈时间</th>--}}
                            {{--</tr>--}}
                        {{--</table>--}}
                        <table class="table my-order-list gogoin" data-token="b85c364572f96a34c7a2e04eeee935e4" style="display: none;">

                            <tr class="warning" style="text-align:center;">
                                <td class="order-num-h">反馈id</td>
                                <td class="order-name-h">反馈概括</td>
                                <td class="order-shoop-h">反馈内容</td>
                                <td class="order-time-h">反馈时间</td>
                                <td>反馈状态</td>
                            </tr>
                            @foreach($aa as $k)
                            <tr class="warning" style="text-align:center;" data-trade-id="2017041300214717421" data-trade-status="0" data-bank-pay="0.00">
                                <td>
                                    <div class="ie8-td-fixed">
                                    {{$k->id}}
                                    </div>
                                </td>
                                <td>
                                    <div class="ie8-td-fixed">
                                        {{$k->up}}
                                    </div>
                                </td>
                                <td class="order-time-b">
                                    <div class="ie8-td-fixed">
                                        {{$k->num}}
                                    </div>
                                </td>
                                <td>
                                    <div class="ie8-td-fixed">
                                        {{date('Y-m-d',$k->addtime)}}
                                    </div>
                                </td>
                                <td>
                                    <div class="ie8-td-fixed">
                                        @if(!$k->in)
                                            未回复
                                            @else
                                            <b class="kkk" style="cursor: pointer">已回复,查看<input type="hidden" value="{{$k->id}}"></b>
                                            @endif

                                    </div>
                                </td>
                            </tr>
                                @endforeach
                            <script>
                                $(function(){
                                    $(this).on('click','.kkk',function(){
                                        $id=$(this).children('input').val();
                                        $.ajax({
                                            url:"{{url('home/Person/kkkfeed')}}",
                                            data:'id='+$id,
                                            type:'get',
                                            success:function(data){
                                                alert(data)
                                            },
                                            error:function(){
                                                alert('出错了请联系管理')
                                            },
                                            datatype:'text'
                                        })
                                    })

                                })
                            </script>
                        </table>
                    </div>
                </div>
                <script>
                    $(function(){
                        $('#gofeed').click(function(){
                            if ($('.readuserfeed').css('height')=='300px'){
                                $('.readuserfeed').animate({height:'0px'},'toggle').css(' overflow','')
                                $('.gogoin').css('display','none')
                            }else{
                                $('.readuserfeed').animate({height:'300px'},'toggle').css(' overflow','scroll')
                                $('.gogoin').css('display','inline')
                            }
                            $.ajax({
                                url:"{{url('home/Person/ajaxfeedback')}}",
                                type:'get',
                                success:function(data){
//                                    alert(data)
//                                    eval('$a='+data)
//                                    for (var i=0; i<$a.length;i++){
//                                        $('.readuserfeed').append('<tr class="warning" style="text-align:center;"><td>'+$a[i].id+'</td><td>'+$a[i].up+'</td></tr>');
//                                    }
                                },
                                error:function(){
                                    alert('出错啦请联系管理员')
                                },
                                datatype:'json'
                            })
                        })
                    })
                </script>
                <form id="profile" class="setting-profile-form" action="" method="post">
                    {{csrf_field()}}
                    <table class="setting-profile-table ">
                        <tbody>
                            <tr>
                                <th>概括:</th>
                                <td>
                                    <div class="mod-cus-sel">
                                        <input type="text"  name="up" >
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th class="personal-detail-th" style="float:left;">反馈问题:</th>
                                <td class="personal-detail-td">
                                    <textarea name="num" id="passport_userdetail" class="mod-cus-input mod-cus-input-4">
                                    </textarea>
                                    <span class="mod-cus-input-tip"></span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    @if(!empty(session('upread')))
                        <script>alert('{{session('upread')}}')</script>
                        @endif
                    <input style="margin-left:90px;width:100px;" type="submit" class="btn btn-success" value="保存">
                    @if(!empty(session('add_xx')))
                        <script>alert('保存成功!')</script>
                    @endif
                </form>
            </div>
        </div>
    </div>
    @if(!empty(session('feebackgo')))
        <script>alert('反馈成功,请耐心等待')</script>
    @endif
@endsection